package com.cheer.param;

import cn.hutool.json.JSONUtil;
import com.cheer.vo.ImgVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel(description = "成果展示")
public class ActivityAchieveUpParam {


    private Integer id;

    @ApiModelProperty("成果展示text")
    private String achieveText;

    @ApiModelProperty("成果展示图片")
    private List<ImgVO> achieveImage;

    /**
     * 获取image 存储为str格式
     * @return
     */
    public String getAchieveImageStr(){
        List<String> list = new ArrayList<>();
        for (int i = 0; i < achieveImage.size(); i++) {
            ImgVO imgVO = achieveImage.get(i);
            list.add(imgVO.getName());
        }
        return JSONUtil.toJsonStr(list);
    }

}
